#include<stdio.h>

int main() 
{
	int a = 0, b = 0;
	scanf("%d%d", &a, &b);
	int i = 0;
	int count_a = 0, count_b = 0;
	int sum_a = 0, sum_b = 0;
	for (i = 1; i < a; i++)
	{
		if (a % i == 0)
		{
			count_a++;
			sum_a += i;
		}
	}
	for (i = 1; i < b; i++)
	{
		if (b % i == 0)
		{
			count_b++;
			sum_b += i;
		}
	}
	if (sum_a == b && sum_b == a)
	{
		printf("yes %d %d", count_a, count_b);
	} else {
		printf("no %d %d", count_a, count_b);
	}
}


